package de.fhluebeck.oop.gps.common;

import org.jdesktop.swingx.mapviewer.GeoPosition;
import org.jdesktop.swingx.mapviewer.Waypoint;

import de.fhluebeck.oop.gps.entity.Poi;

/**
 * 
 * Enthölt eine Referenz zur Datenbank Entität POI.
 * Diese Klasse dient dazu die Verknüpfung zwischen Darstellung im UserInterface und
 * Datenbank Inhalt herzustellen
 * 
 * @author Ogün Bilge, Leif Hitzschke
 * @version 1.00, 13.11.2009
 */
public class PoiEnabledWaypoint extends Waypoint {
	private Poi poi;

	public PoiEnabledWaypoint(Poi poi, GeoPosition coord) {
		super(coord);
		this.poi = poi;
	}

	public Poi getPoi() {
		return poi;
	}
	

	public void setPoi(Poi poi) {
		this.poi = poi;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((poi == null) ? 0 : poi.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		PoiEnabledWaypoint other = (PoiEnabledWaypoint) obj;
		if (poi == null) {
			if (other.poi != null)
				return false;
		} else if (!poi.equals(other.poi))
			return false;
		return true;
	}
	
	
}